//
// Created by PC on 2023/10/16.
// 素数 埃式筛法
//


#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int a=100; // out: 25
    a = 1740948; // out: 130971
//    a = 2115790; //out:156902
//    a=91571465;// out: 5302853
//    a = 65090061389;//out: 2728793966
//    cin>>a;
    bool arr[a+1]={0};
    for (int i = 2; i < a+1; ++i)
        arr[i]=1;
//    for (int i = 2; i <=a+1 ; ++i)
    for (int i = 2; i <=int(sqrt(a+1)) ; ++i)
    {
        if(arr[i])
        {
            for (int j = i*i; j < a+1; j+=i)
            {
                arr[j]=0;
            }
        }
    }
    int count=0;
    for (int i = 2; i < a+1; ++i)
    {
        if(arr[i])
            count++;
    }
    cout<<count;

    return 0;
}